<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="WEB-INF/templates/template.xhtml">
	<ui:define name="content">

		<h:form id="form">

			<p:panel id="panel" header="Acesso">

				<p:messages id="msgs" />

				<h:panelGrid columns="3">
				
					<h:outputText for="tipo" value="Escolha seu acesso:"></h:outputText>
					<p:selectOneRadio id="tipo" value="#{loginController.conta.adm}" required="true">
						<f:selectItem itemLabel="Cliente" itemValue="false" />
						<f:selectItem itemLabel="Funcionário" itemValue="true" />
					</p:selectOneRadio>
					<p:message for="tipo" display="icon"/>


					<h:outputLabel for="login" value="Usuário: *" />
					<p:inputText id="login" value="#{loginController.conta.login}" required="true" label="Usuário">
						<f:validateLength minimum="2" />
					</p:inputText>
					<p:message for="login" display="icon" />

					<h:outputLabel for="senha" value="Senha: *" />
					<p:password id="senha" value="#{loginController.conta.senha}"
						label="Senha" required="true">
						<f:validateLength minimum="6" />
					</p:password>
					<p:message for="senha" display="icon" />
				</h:panelGrid>

				<p:commandButton id="btn" value="Acessar" action="#{loginController.doLogin}" ajax="false" />
			</p:panel>
		</h:form>

	</ui:define>
</ui:composition>
</html>